
{% macro menu(menuKey, key) %}{{ "layui-nav-item layui-this" if menuKey == key else "layui-nav-item" }}{% endmacro %}
{% macro openSubMenu(menuKey, keys) %}{% for key in keys %}{{ "layui-nav-item layui-nav-itemed" if menuKey == key else "layui-nav-item" }}{% endfor %}{% endmacro %}
{% macro subMenu(menuKey, key) %}{% if menuKey == key %}layui-this{% endif %}{% endmacro %}

<div class="layui-side layui-bg-black">
  <div class="layui-side-scroll">
    <!-- 左侧导航区域（可配合layui已有的垂直导航） -->
    <ul class="layui-nav layui-nav-tree"  lay-filter="test">
      <li class="{{ menu(menuKey, 'wpn-dashboard') }}"><a href="/dashboard">首页</a></li>
      <li class="{{ menu(menuKey, 'wpn-customer-list') }}"><a href="/customer/list">患者</a></li>
      <li class="layui-nav-item"><a href="/messsage/list">咨询</a></li>
      <li class="{{ menu(menuKey, 'wpn-specialist-list') }}"><a href="/specialist/list">专家</a></li>
      <li class=" {{ openSubMenu(subMenuKey, ['wpn-sub-order-list']) }}">
        <a class="" href="javascript:;">预约</a>
        <dl class="layui-nav-child">
          <dd><a class="{{ subMenu(subMenuKey, 'wpn-sub-order-list') }}" href="/sub-order/list">预约记录</a></dd>
        </dl>
      </li>
      <li class="layui-nav-item">
        <a class="" href="javascript:;">订单</a>
        <dl class="layui-nav-child">
          <dd><a class="" href="/order/list">订单列表</a></dd>
        </dl>
      </li>
      <li class="layui-nav-item">
        <a class="" href="javascript:;">医院管理</a>
        <dl class="layui-nav-child">
          <dd><a class="" href="/dashboard">医生</a></dd>
          <dd><a href="/user">科室</a></dd>
          <dd><a href="/user">常见病</a></dd>
        </dl>
      </li>
      <li class="layui-nav-item">
        <a class="" href="javascript:;">数据</a>
        <dl class="layui-nav-child">
          <dd><a class="" href="/dashboard">访客</a></dd>
          <dd><a href="/user">科室</a></dd>
          <dd><a href="/user">常见病</a></dd>
        </dl>
      </li>
      <li class="layui-nav-item">
        <a class="" href="javascript:;">系统管理</a>
        <dl class="layui-nav-child">
          <dd><a class="" href="/dashboard">用户</a></dd>
          <dd><a href="/user">权限</a></dd>
        </dl>
      </li>
      <li class="layui-nav-item"><a href="">小程序</a></li>
    </ul>
  </div>
</div>